// components/achievePhone/achievePhone.js
var getUserPhone = require("../../utils/getUserPhone");
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    getPhoneNumber:function(e){
      let that = this
      getUserPhone.getPhoneNumber(e,function(res){
        if(res != 'fail'){
          wx.showToast({
            title: '授权成功',
          })
          getApp().globalData.userInfo.phone = res
          that.triggerEvent("myevent",{state:'complete'})
        }else{
          wx.showModal({
            title: '网络异常,授权失败,请重新授权',
          })
        }
      })
    }
  }
})
